Skip to content

fix(referrals): validate positive cent amounts - #5

Merged
ralyodio merged 1 commit into
profullstack:mainfrom
rissrice2105-agent:fix/referral-amount-validation
Jul 31, 2026
Merged

fix(referrals): validate positive cent amounts#5
ralyodio merged 1 commit into
profullstack:mainfrom
rissrice2105-agent:fix/referral-amount-validation

Conversation

@rissrice2105-agent

Copy link
Copy Markdown
Contributor

Summary

  • requires referral purchase amounts to be positive safe integer cents
  • rejects zero, negative, fractional, unsafe, non-number, and missing values with HTTP 400
  • prevents invalid commission and discount amounts from being persisted
  • adds route-level regression coverage that verifies no usage is saved

Validation

  • vitest run tests/referrals.test.ts (45 tests)
  • full suite: 254 tests
  • tsc --noEmit
  • tsup build
  • git diff --check

Closes #4

@ralyodio
ralyodio merged commit 0875181 into profullstack:main Jul 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Referral apply route accepts negative and fractional cent amounts

2 participants